Says whether bg repeats past the edge of its picture. true is what the console does by itself; false leaves the screen’s own color past the edge.
Works differently on Game Boy - The Game Boy decides this when the game is built, from the last choice written in plain words in the room's code: the picture again every 256 pixels, black, its edge tiles carried outward, or one color. Written while playing, it does nothing.
Works differently on Game Boy Color - The Game Boy Color decides this when the game is built, from the last choice written in plain words in the room's code: the picture again every 256 pixels, black, its edge tiles carried outward, or one color. Written while playing, it does nothing.
Sega Genesis: not built yet
On other consoles this differs: see Side by side and How the consoles differ.
background_repeat(bg, repeat)| Name | Type |
|---|---|
bg | background |
repeat | bool |
Nothing.
Says whether bg repeats past the edge of its picture. A no-op on nothing.
The console repeats a background: move the picture far enough and the same picture starts again next to itself, like tiles on a floor. That is what true means, and it is what every background does until you say otherwise. With false, nothing shows past the picture's edge except the screen's own color (and whatever is drawn behind the background).
The change happens the next time a Draw event draws the background, and it stays until you change it again. background_repeat(bg, false) is the same as background_edge(bg, EDGE_EMPTY); for the other two choices, a stretched edge and one color, use background_edge.
You can also choose without code: the picture has a Repeat box in the Paint tab, under the canvas. background_create reads it, so a picture with the box unticked makes backgrounds that do not repeat. This call changes one background after it was made.
How it is done. The engine picks the cheapest way that works.
A zoomable background does not repeat unless you ask for it; its own switch is zoom_background_repeat.
backdrop = background_create(0, 0, ts_doc_dungeon);
background_repeat(backdrop, false);Makes a background from the dungeon picture and turns its repeating off, so moving the view past the picture's edge shows the screen's own color instead of a second copy of the dungeon.
A no-op on `nothing`. It takes effect the next time a Draw event draws the background, and it stays until you change it. The engine picks the cheapest way that works. If the picture is small, with art that leaves a whole screen of empty space round it in the picture (a picture 512 wide with art 128 wide, say), the empty space already does the job and the engine only skips drawing the background in a frame where none of the art would show: that costs nothing. Otherwise it takes one of the console’s two rectangle windows and shows the background only inside the picture’s box. Those two windows are shared with screen transitions that cut shapes and with overlay effects that have a shape, so if both are taken, the background keeps repeating and the development log says so in plain words. A picture can start without repeating if you turn its Repeat setting off in the Paint tab; this call changes one background after it was made. A zoomable background has its own switch, zoom_background_repeat.